Perform the following operations using only the dplyr library. We will be reviewing the following operations:
library(dplyr)
We will use the mtcars dataframe for this exercise!
head(mtcars)
Return rows of cars that have an mpg value greater than 20 and 6 cylinders.
Reorder the Data Frame by cyl first, then by descending wt.
Select the columns mpg and hp
Select the distinct values of the gear column.
Create a new column called "Performance" which is calculated by hp divided by wt.
Find the mean mpg value using dplyr.
Use pipe operators to get the mean hp value for cars with 6 cylinders.